/* eslint-disable import/prefer-default-export */
import { useState } from 'react';

const useLayout = () => {
    const [scale, innerSetScale] = useState(1);
    const setScale = e => {
        let newScale = Number(e.toFixed(2));
        if (newScale < 0.1) {
            newScale = 0.1;
        }
        if (newScale > 2) {
            newScale = 2;
        }
        innerSetScale(newScale);
    };
    return {
        scale,
        setScale
    };
};
export { useLayout };
